<template>
    <view>
        <web-view :src="previewUrl" style="width: 100%; height: 500px;"></web-view>
    </view>
</template>



<script setup>
import { ref } from 'vue'
import { onLoad, onShow } from "@dcloudio/uni-app";
import request from "@/api/request.js";
import jsPreviewDocx from "@js-preview/docx";
import '@js-preview/docx/lib/index.css';

const previewUrl = ref('')
onLoad((options) => {
    console.log(options.url)
    if (options.url) {
        previewUrl.value = options.url
    }
})

async function getPreviewUrl(fileName) {
    let res = await request.get(`/api/documents/convert-to-html/${fileName}`)
    console.log(res, '..')
    if (res.code === 200) {
        previewUrl.value = res.data.html;
    }
}
</script>
